package jicheng;

public class sonyingoyongchangjing {
    public static void main(String[] args) {


    Teather t =new Teather("libai",1999,"飞天");
        System.out.println(t.getName());
        System.out.println(t.getAge());
        System.out.println(t.getSkill());
}

}
class  Teather extends Pe0ple{
    private String skill;
    public Teather (String x,int y,String skill) {
        super(x,y);//调用父类中的变量为自己所用减少了代码
        this.skill = skill;
    }

    public String getSkill() {
        return skill;
    }

    public void setSkill(String skill) {
        this.skill = skill;
    }
}
class Pe0ple{
    private String name;
    private  int age;

    public Pe0ple() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Pe0ple(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class x{
    private  String name;
    private  int age;
    private  String schoolName;
    public x(String name,int age){
        this(name,age,"情话");//此时的是调用的下方的构造器，无需在多写代码

    }
    public x(String name, int age, String schoolName) {
        this.name = name;
        this.age = age;
        this.schoolName = schoolName;
    }
}
